<template>
  <view class="container">
    <!-- 使用web-view组件嵌入外部网页 -->
    <web-view :src="webviewUrl" :user-agent="customUserAgent"></web-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      webviewUrl: 'https://m.psyctest.cn/tests/', // 来自互联网的心理测试
      customUserAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' // 自定义User-Agent
    };
  },
  onLoad() {
    // 可以在加载时动态设置User-Agent
    this.customUserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36';
  }
};
</script>

<style scoped>
.container {
  width: 100%;
  height: 100%;
}
</style>